package com.yxw.yx_hotel.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.yxw.yx_hotel.vo.DeptVO;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.List;

/**
 * 部门实体类 yx_cs_dept
 *
 * @author xiexuxin
 * @date 2023-09-14
 */
@Data
@TableName("yx_hotel_dept")
@ApiModel("部门实体类")
public class YxCsDeptEntity implements Serializable {
    private static final long serialVersionUID = 1L;

    @TableId(value = "dept_id",type = IdType.ASSIGN_ID)
    @ApiModelProperty("部门ID")
    private Long deptId;

    @TableField(value="parent_id")
    @ApiModelProperty("父部门id")
    private Long parentId;

    @TableField(value="ancestors")
    @ApiModelProperty("祖级列表")
    private String ancestors;

    @TableField(value="dept_name")
    @ApiModelProperty("部门名称")
    private String deptName;

    @TableField(value="order_num")
    @ApiModelProperty("显示顺序")
    private Integer orderNum;

    @TableField(value="leader")
    @ApiModelProperty("负责人")
    private String leader;

    @TableField(value="phone")
    @ApiModelProperty("联系电话")
    private String phone;

    @TableField(value="email")
    @ApiModelProperty("邮箱")
    private String email;

    @TableField(value="dept_reb")
    @ApiModelProperty("部分职责范围")
    private String deptReb;

    @TableField(value="status")
    @ApiModelProperty("部门状态")
    private Integer status;

    @TableField(value="del_flag")
    @ApiModelProperty("删除标志")
    private Integer delFlag;

    @TableField(value="is_parent")
    @ApiModelProperty("是否为父级")
    private Integer isParent;

    @TableField(value="create_by")
    @ApiModelProperty("创建者")
    private String createBy;

    @TableField(value="create_time")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty("创建时间")
    private LocalDateTime createTime;

    @TableField(value="update_by")
    @ApiModelProperty("更新者")
    private String updateBy;

    @TableField(value="update_time")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty("更新时间")
    private LocalDateTime updateTime;

    @TableField(value="tenant_id")
    @ApiModelProperty("租户ID")
    private Long tenantId;

    @TableField(exist = false)
    private List<DeptVO> children = new ArrayList<>();

}
